#include "../client/client.h"
#include "../client/clientwaitpool.h"
#include "../client/responsehandlerthreadpool.h"
#include "../client/responsehandlerthread.h"

#include "../pjsipwrapper/pjsipwrapper.h"
#include "../session/session.h"
#include "../session/sessionmanager.h"
#include "../session/userhandler.h"
#include "../account/account.h"
#include "../config/config.h"

int main()
{
    Account *myaccount = new Account("siptest002", "123456");

    UserHandler *user_handler = new UserHandler();
    UserCallback *cb = new UserCallback(user_handler);
    PjApiUa::getInstance()->registerAccountHandler(user_handler->getPjApiHandler());

    user_handler->getPjApiHandler()->setTransportConfig();
    user_handler->getPjApiHandler()->setRtpPort(4000);
    user_handler->getPjApiHandler()->setNullDevice();

    PjApiUa::getInstance()->start();
    user_handler->getPjApiHandler()->setAccount(myaccount);
    user_handler->getPjApiHandler()->setAccountCallback(cb);

    std::string to = "sip:siptest002@211.100.17.183";

    while (i<100000000)
    {
        i++;
    }
    i = 0;
    while (i<100000000)
    {
        i++;
    }

    int id = user_handler->startSession(to);
    i = 0;
    while (i<100000000)
    {
        i++;
    }
    while(1)
    {}
    return 0;

}
